package com.slsoft.sys.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import cn.fastmc.core.jpa.service.BaseService;

import com.slsoft.core.action.BaseController;
import com.slsoft.sys.entify.ConfigProperty;
import com.slsoft.sys.service.ConfigPropertyService;
@Controller
@RequestMapping("sys/config")
public class ConfigAction extends BaseController<ConfigProperty, String> {
	@Autowired
	private ConfigPropertyService configPropertyService;
	
	@RequestMapping("index")
	public String index() {
		return "/admin/sys/config/list";
	}
	
	@Override
	protected BaseService<ConfigProperty, String> getEntityService() {
		return this.configPropertyService;
	}
	//,headers = {"Content-type=application/json;charset=UTF-8"}
	@RequestMapping(value="save",method = RequestMethod.POST)
	public void save(@RequestBody  List<ConfigProperty> data,HttpServletRequest request,HttpServletResponse response){
		configPropertyService.save(data);
	}
}
